package com.cari.oa.dao;

import java.util.List;

import org.hibernate.Query;
import org.springframework.stereotype.Repository;

import com.cari.oa.domain.SoftAttachementEntity;

@Repository
public class SoftAttachementDao extends BaseDao<SoftAttachementEntity> {

	/**
	* Title: getByBugId
	* Description:获取某个bug的所有附件
	* @author    hjx 
	* @date      2013-2-1 
	* @param     bugId
	* @return
	*/
	@SuppressWarnings("unchecked")
	public List<SoftAttachementEntity> getByBugId(String bugId) {
		   Query query = getSession().createQuery("from SoftAttachementEntity a where a.bugId = :bugId");
		   query.setString("bugId", bugId);
		   List<SoftAttachementEntity> list = query.list();
		   return list;
	}
}
